home *** CD-ROM | disk | FTP | other *** search
- #include "String.h"
-
- RJS_String &RJS_String::reverse()
- {
- int n=length()/2;
- char temp;
- int loc,i;
-
- for (i=0; i< n; i++) {
- loc=length()-i-1;
- temp=sd.data[i];
- sd.data[i]=sd.data[loc];
- sd.data[loc]=temp;
- }
- update();
- return *this;
- }
-
- RJS_String reverse(const char *s)
- {
- RJS_String st(s);
- st.reverse();
- return st;
- }
-
- RJS_String reverse(const RJS_String &s)
- {
- RJS_String st(s);
- st.reverse();
- return st;
- }
-
-